id_card = "110101199003074512"

# 1. 提取前6位地址码
address_code = id_card[:6]
print("地址码：", address_code)
birth_year1 = id_card[6:10]
print("出生年（正索引）：", birth_year1)
birth_year2 = id_card[-12:-8]
print("出生年（负索引）：", birth_year2)
birth_month = id_card[10:12]
birth_day = id_card[12:14] 
print(f"出生年月：{birth_year1} 年 {birth_month} 月 {birth_day} 日")
gender_code = id_card[16]  # 第17位（索引16）
gender = "男" if int(gender_code) % 2 == 1 else "女"
print("性别：", gender)
